<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "/include/head_common.html"> 
<#include "/include/tree_table.html">
    <title>用户管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
    	function page(n, s) {
        	$("#pageNum").val(n);
        	$("#pageSize").val(s);
        	$("#searchForm").submit();
        	return false;
    	}
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="list">用户列表</a></li>
    <li><a href="edit">用户添加</a></li>
</ul>
<form id="searchForm" action="list" method="post"
           class="breadcrumb form-search ">
    <input id="pageNum" name="pageNum" type="hidden" value="${page.pageNum}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <ul class="ul-form">
        <li>
        	<label>所属公司：</label>
        	<@wolfking.treeView id="company" name="companyId" 
						value="${user.companyId!''}" 
						labelName="${company.name!''}"
                        labelValue="${company.name!''}"
                        title="公司" 
                        url="/office/treeData"
                        cssClass="input-small"
                        allowClear="true">
					<#include "/tool/treeTag.html">
			</@wolfking.treeView>
		</li>
        <li>
        	<label>登录名：</label>
        	<input type="text" name ="loginName" value="${user.loginName!''}" maxlength="50" class="input-medium"/>
        </li>
        <li class="clearfix"></li>
        <li>
        	<label>归属部门：</label>
        	<@wolfking.treeView id="office" name="officeId" 
						value="${user.officeId!''}" 
						labelName="${office.name!''}"
                        labelValue="${office.name!''}"
                        title="部门" 
                        url="/office/treeData"
                        cssClass="input-small"
                        allowClear="true">
					<#include "/tool/treeTag.html">
			</@wolfking.treeView>
		</li>
        <li>
        	<label>姓&nbsp;&nbsp;&nbsp;名：</label>
        	<input name="name" type="text" value="${user.name!''}" maxlength="50" class="input-medium"/>
        </li>
        <li class="btns">
        	<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
		</li>
        <li class="clearfix"></li>
    </ul>
</form>
<#include "/include/message.html">
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>归属公司</th>
        <th>归属部门</th>
        <th class="sort-column login_name">登录名</th>
        <th class="sort-column name">姓名</th>
        <th>电话</th>
        <th>手机</th>
        <th>操作</th>
	</tr>
    </thead>
    <tbody>
    <#list page.list as data>  
        <tr>
            <td>
				<#if data.companyId??> ${officeMap[data.companyId]}<#else>无</#if>
            </td>
            <td>
            	<#if data.officeId??>${officeMap[data.officeId]}<#else>无</#if>
            </td>
            <td><a href="edit?id=${data.id!''}">${data.loginName}</a></td>
            <td>${data.name!''}</td>
            <td>${data.phone!''}</td>
            <td>${data.mobile!''}</td>
            <td>
               <a href="edit?id=${data.id!''}">修改</a>
               <a href="delete?id=${data.id!''}" onclick="return confirmx('确认要删除该用户吗？', this.href)">删除</a>
            </td>
        </tr>
    </#list>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>